/*
 * Copyright 2020 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../Card/mixins';

$border-radius: 2px 4px;
$table-background-color: var(--color-base00);

$bar-height-small: 0.6875rem; /* e.g. note: use 1rem for 16px */
$bar-height-medium: 0.6875rem; /* e.g. 11px */
$bar-height-large: 0.5625rem; /* e.g. 9px */
$bar-height-huge: 0.5rem; /* e.g. 8px */

$grid-cell-hover-filter: saturate(2) brightness(1.25);

@mixin TableOuter {
  .kui--data-table-wrapper {
    @content;
  }
}

@mixin Table {
  table.kui--table-like-wrapper {
    @content;
  }
}

@mixin TableContainer {
  .kui--data-table-container {
    @content;
  }
}

@mixin LightweightTableContainer {
  .kui--data-table-wrapper-lightweight {
    @content;
  }
}

@mixin TableCard {
  @include Card {
    &.kui--table-card {
      @content;
    }
  }
}

@mixin TableHeadCell {
  th.kui--header-cell {
    @content;
  }
}

@mixin TableHeadCellForColumn($col) {
  @include TableHeadCell {
    &[data-key='#{$col}'] {
      @content;
    }
  }
}

@mixin TableRow {
  tr {
    @content;
  }
}

@mixin TableCell {
  td {
    @content;
  }
}

@mixin BadgeColoredPart {
  [data-tag='badge-circle'] {
    @content;
  }
}

@mixin StatusBadge {
  [data-tag='badge'] {
    @include BadgeColoredPart {
      @content;
    }
  }
}

@mixin TableToolbarButtons {
  .kui--data-table-toolbar-buttons {
    @content;
  }
}

@mixin TableAsGrid {
  @include TableOuter {
    &.kui--data-table-as-grid {
      @content;
    }
  }
}
@mixin Grid {
  .kui--table-like-wrapper.kui--data-table-as-grid {
    @content;
  }
}
